 package com.iprojectmanager.views;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
//import com.iprojectmanager.entities.*;
//import com.iprojectmanager.managers.*;

/**
 *
 * @author Alucard
 */
public class Inicio extends Vista
{ 
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
       /*IProjectManager m = new IProjectManager();
            Administrador user = new Administrador("root","root","Sergio","Trejo","Sandoval","email",
                                       "telefono","celular","direccion");
                m.exec(user, IProjectManager.INSERT);*/
        String msg="Entrada al Sistema";
        PrintWriter out = response.getWriter();
            if(request.getAttribute("Error") != null)
            {
                msg = request.getAttribute("Error").toString();
            }
        
            out.println(Utilities.getDocType());
            out.println("<HTML>" + Utilities.getHead(msg,"#linkList{display:none};div[id=\"estado\"]{display:none};"));
            out.println("<div id=\"container\">");
            out.println(Utilities.getIntro(msg));

            String form =
                    "<div id=\"pageContent\">" +
                    "<div id=\"selection1\">" +
                        "<h3><span>Acceso al Sistema " + msg +"</span></h3>" +
                        "<p class=\"p1\"><span>" +
                            "<form action=\"UserControl\" method=\"GET\">" +
                                "<label>Nombre de usuario:</label>" +
                                    "<input name =\"user\" type=\"text\"> </input><br></br>" +
                                "<label>Password:</label>" +
                                    "<input name=\"password\" type=\"password\"> </input><br></br>" +
                                "<button type=\"submit\"> iniciar </button>" +
                            "</form>" +
                        "</span></p>" +
                            Utilities.getFooter() +
                    "</div>";

            out.println(form);
            out.println(Utilities.getMenu());
            out.println("</div> <!-- fin container---></BODY></HTML>");
            out.close();
    } 
}
